<template>
	<view class="pay">
		<view class="image-box">
			<image src="/static/image/pay.png" mode="" class="img"></image>
		</view>
		<view class="title-box">
			<view class="titleone">恭喜您</view>
			<view class="titletwo">本次交易支付成功</view>
		</view>
		<view class="price">￥{{price}}</view>
		<button class="btn" @click="ToOrder">返回首页</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				price: '',
				count: 3,
			}
		},
		onLoad(option) {
			this.price = option.price
		},
		onShow() {
			setInterval(() => {
				this.count--
				if (this.count === 0) {
					uni.navigateTo({
						url: '/pages/Order/Order'
					})
				}
			}, 1000)
		},
		methods: {
			ToOrder() {
				uni.switchTab({
					url: '/pages/Order/Order'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.pay {
		text-align: center;

		.img {
			width: 309rpx;
			height: 298rpx;
			margin: 71rpx 0;
		}

		.title-box {
			color: #B6B6B6;
			font-size: 26rpx;
		}

		.price {
			color: #F4370F;
			font-size: 48rpx;
			margin: 16rpx 0 78rpx;
		}

		.btn {
			width: 279rpx;
			height: 72rpx;
			line-height: 72rpx;
			border-radius: 40rpx;
			background-color: #EB2041;
			color: #fff;
		}

	}
</style>
